<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width= , initial-scale=1.0">
    <title>Document</title>
</head>
<script src="../js/vue.js"></script>
<body>
    <h4>组件语法糖的使用</h4>
    <div id="app"> 
       <cpn1></cpn1>
       <cpn2></cpn2>
    </div>
    
    
    <script>
        // 1.创建组件构造器对象
        Vue.component('cpn1',{
            template: `
                <div>
                    <h4>我是标题1</h4>
                    <p>我是内容，哈哈哈哈哈哈</p>
                </div>`
        })
        
         const app = new Vue({
            el: '#app',    
            data: {    
                message: '你好，VUE'  
            },
            methods: {
                
            },
            components: {
                // 局部组件的注册
                 cpn2: {
                     template: `
                <div>
                    <h4>我是标题2</h4>
                    <p>我是海王，呵呵呵呵呵呵</p>
                </div>`
                 }
            }
        })
        


    </script>
</body>
</html>